SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

create procedure dbo.DnnProduct_VerifyPortalTab

@PortalID int,
@TabId    int

as

select dbo.DnnProduct_Tabs.TabId
from dbo.DnnProduct_Tabs
left outer join dbo.DnnProduct_Portals on dbo.DnnProduct_Tabs.PortalId = dbo.DnnProduct_Portals.PortalId
where  TabId = @TabId
and    ( dbo.DnnProduct_Portals.PortalId = @PortalID or dbo.DnnProduct_Tabs.PortalId is null )
and    IsDeleted = 0









GO
